<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>cocos.actions.base_actions.IntervalAction</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar">
  <tr valign="middle">
  <!-- Project homepage -->
      <!--<th class="navbar" 
            ><a class="navbar" target="_top" href="http://www.cocos2d.org/">cocos2d API reference</a></th>-->

  <!-- Tree link -->
      <th><a
        href="module-tree.html">Trees</a></th>

  <!-- Index link -->
      <th><a
        href="identifier-index.html">Indices</a></th>

  <!-- Breadcrumbs -->
      <th class="navbar-breadcrumbs">
        <span class="breadcrumbs">
          <a href="cocos-module.html">cocos</a>&nbsp;.&nbsp;<a href="cocos.actions-module.html">actions</a>&nbsp;.&nbsp;<a href="cocos.actions.base_actions-module.html">base_actions</a>&nbsp;.&nbsp;IntervalAction
        </span>
      </th>

      <th class="navbar last">
        <a href="javascript:toggleFrames()">Toggle&nbsp;frames</a>
      </th>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class cocos.actions.base_actions.IntervalAction</h1>
<pre class="base-tree">
<a href="cocos.actions.base_actions.Action-class.html">Action</a> --+
         |
        <strong class="uidshort">IntervalAction</strong>
</pre>

<dl><dt>Known Subclasses:</dt>
<dd>
    <a href="cocos.skeleton.Animate-class.html">skeleton.Animate</a>,
    <a href="cocos.actions.base_actions.InstantAction-class.html">InstantAction</a>,
    <a href="cocos.actions.camera_actions.Camera3DAction-class.html">camera_actions.Camera3DAction</a>,
    <a href="cocos.actions.basegrid_actions.GridBaseAction-class.html">basegrid_actions.GridBaseAction</a>,
    <a href="cocos.actions.basegrid_actions.AccelAmplitude-class.html">basegrid_actions.AccelAmplitude</a>,
    <a href="cocos.actions.basegrid_actions.AccelDeccelAmplitude-class.html">basegrid_actions.AccelDeccelAmplitude</a>,
    <a href="cocos.actions.interval_actions.AccelDeccel-class.html">interval_actions.AccelDeccel</a>,
    <a href="cocos.actions.interval_actions.Accelerate-class.html">interval_actions.Accelerate</a>,
    <a href="cocos.actions.interval_actions.Bezier-class.html">interval_actions.Bezier</a>,
    <a href="cocos.actions.interval_actions.Blink-class.html">interval_actions.Blink</a>,
    <a href="cocos.actions.interval_actions.Delay-class.html">interval_actions.Delay</a>,
    <a href="cocos.actions.interval_actions.FadeOut-class.html">interval_actions.FadeOut</a>,
    <a href="cocos.actions.interval_actions.FadeTo-class.html">interval_actions.FadeTo</a>,
    <a href="cocos.actions.interval_actions.Jump-class.html">interval_actions.Jump</a>,
    <a href="cocos.actions.interval_actions.JumpBy-class.html">interval_actions.JumpBy</a>,
    <a href="cocos.actions.interval_actions.Lerp-class.html">interval_actions.Lerp</a>,
    <a href="cocos.actions.interval_actions.MoveTo-class.html">interval_actions.MoveTo</a>,
    <a href="cocos.actions.interval_actions.RotateBy-class.html">interval_actions.RotateBy</a>,
    <a href="cocos.actions.interval_actions.RotateTo-class.html">interval_actions.RotateTo</a>,
    <a href="cocos.actions.interval_actions.ScaleTo-class.html">interval_actions.ScaleTo</a>,
    <a href="cocos.actions.interval_actions.Speed-class.html">interval_actions.Speed</a>,
    Loop_IntervalAction,
    Sequence_IntervalAction,
    Spawn_IntervalAction
</dd></dl>

<p>IntervalAction()</p>
<p>Interval Actions are the ones that have fixed duration, known when the
worker instance is created, and, conceptually, the expected duration must
be positive.
Degeneratated cases, when a particular instance gets a zero duration, are
allowed for convenience.</p>
<p>IntervalAction adds the method update to the public interfase, and it
expreses the changes to target as a function of the time elapsed, relative
to the duration, ie f(time_elapsed/duration).
Also, it is guaranted that in normal termination .update(1.0) is called.
Degenerate cases, when a particular instance gets a zero duration, also
are guaranted to call .update(1.0)
Note that when a premature termination happens stop will be called but
update(1.0) is not called.</p>
<p>Examples: <a href="cocos.actions.interval_actions.MoveTo-class.html" class="link">MoveTo</a> , <a href="cocos.actions.interval_actions.MoveBy-class.html" class="link">MoveBy</a> , <a href="cocos.actions.interval_actions.RotateBy-class.html" class="link">RotateBy</a> are strictly Interval Actions,
while <a href="cocos.actions.instant_actions.Place-class.html" class="link">Place</a>, <a href="cocos.actions.instant_actions.Show-class.html" class="link">Show</a> and <a href="cocos.actions.instant_actions.CallFunc-class.html" class="link">CallFunc</a> aren't.</p>
<p>While
RotateBy(angle, duration) will usually receive a positive duration, it
will accept duration = 0, to ease on cases like
action = RotateBy( angle, a-b )</p>

<!-- ==================== METHODS ==================== -->
<a name="section-Methods"></a>
        <h2>Methods</h2>
<table class="summary">
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.IntervalAction-class.html#step" class="summary-sig-name">step</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">dt</span>)</span>
<div class="summary-description">Dont customize this method: it will not be called when in the component
role for certain composite actions (like Sequence_IntervalAction).</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="update"></a><span class="summary-sig-name">update</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">t</span>)</span>
<div class="summary-description">Gets called on every frame
't' is the time elapsed normalized to [0, 1]
If this action takes 5 seconds to execute, <code class="link">t</code> will be equal to 0
at 0 seconds.</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.IntervalAction-class.html#done" class="summary-sig-name">done</a>(<span class="summary-sig-arg">self</span>)</span>
<div class="summary-description">When in the worker role, this method is reliable.</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.IntervalAction-class.html#__mul__" class="summary-sig-name">__mul__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span>
<div class="summary-description">repeats ntimes the action
action * n -&gt; action_result
where action result performs as:
repeat n times the changes that action would do</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="__add__"></a><span class="summary-sig-name">__add__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">action</span>)</span>
<div class="summary-description">sequence operator - concatenates actions
action1 + action2 -&gt; action_result
where action_result performs as:
first do all that action1 would do; then
perform all that action2 would do</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="__init__"></a><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">*args</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span>
<div class="summary-description">dont override - use init</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="__or__"></a><span class="summary-sig-name">__or__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">action</span>)</span>
<div class="summary-description">spawn operator -  runs two actions in parallel
action1 | action2 -&gt; action_result</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="__reversed__"></a><span class="summary-sig-name">__reversed__</span>(<span class="summary-sig-arg">self</span>)</span>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.Action-class.html#init" class="summary-sig-name">init</a>(<span class="summary-sig-arg">*args</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span>
<div class="summary-description">Gets called by __init__ with all the parameteres received,
At this time the target for the action is unknown.</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.Action-class.html#start" class="summary-sig-name">start</a>(<span class="summary-sig-arg">self</span>)</span>
<div class="summary-description">External code sets self.target and then calls this method.</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="stop"></a><span class="summary-sig-name">stop</span>(<span class="summary-sig-arg">self</span>)</span>
<div class="summary-description">When the action must cease to perform this function is called by
external code; after this call no other method should be called.</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
        <h2>Instance Variables</h2>
<table class="summary">
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="target"></a><span class="summary-name">target</span>
<div class="summary-description"><a href="cocos.cocosnode.CocosNode-class.html" class="link">CocosNode</a> object that is the target of the action</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
        <h2>Method Details</h2>
<table class="details">
</table>
<a name="step"></a>
<div class=" detail">
  <h3>step</h3>
  <div class="detail-signature">
    <span class="sig"><span class="sig-name">step</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">dt</span>)</span>
    </div>
  <div class="detail-description">
  Dont customize this method: it will not be called when in the component
role for certain composite actions (like Sequence_IntervalAction).
In such situation the composite will calculate the suitable t and
directly call .update(t)
You customize the action stepping by overriding .update
  <dl class="fields">
    <dt>Overrides:</dt>
    <dd class="overrides">
      <a href="cocos.actions.base_actions.Action-class.html#step">Action.step</a>
    </dd>
  </dl>
  </div>
</div>
<a name="done"></a>
<div class=" detail">
  <h3>done</h3>
  <div class="detail-signature">
    <span class="sig"><span class="sig-name">done</span>(<span class="sig-arg">self</span>)</span>
    </div>
  <div class="detail-description">
  When in the worker role, this method is reliable.
When in the component role, if the composite spares the call to
step this method cannot be relied (an then the composite must decide
by itself when the action is done).
Example of later situation is Sequence_IntervalAction.
  <dl class="fields">
    <dt>Overrides:</dt>
    <dd class="overrides">
      <a href="cocos.actions.base_actions.Action-class.html#done">Action.done</a>
    </dd>
  </dl>
  </div>
</div>
<a name="__mul__"></a>
<div class=" detail">
  <h3>__mul__</h3>
  <div class="detail-signature">
    <span class="sig"><span class="sig-name">__mul__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">other</span>)</span>
    </div>
  <div class="detail-description">
  repeats ntimes the action
action * n -&gt; action_result
where action result performs as:
repeat n times the changes that action would do
  <dl class="fields">
    <dt>Overrides:</dt>
    <dd class="overrides">
      <a href="cocos.actions.base_actions.Action-class.html#__mul__">Action.__mul__</a>
    </dd>
  </dl>
  </div>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar">
  <tr valign="middle">
  <!-- Project homepage -->
      <!--<th class="navbar" 
            ><a class="navbar" target="_top" href="http://www.cocos2d.org/">cocos2d API reference</a></th>-->

  <!-- Tree link -->
      <th><a
        href="module-tree.html">Trees</a></th>

  <!-- Index link -->
      <th><a
        href="identifier-index.html">Indices</a></th>

  <!-- Breadcrumbs -->
      <th class="navbar-breadcrumbs">
        <span class="breadcrumbs">
          <a href="cocos-module.html">cocos</a>&nbsp;.&nbsp;<a href="cocos.actions-module.html">actions</a>&nbsp;.&nbsp;<a href="cocos.actions.base_actions-module.html">base_actions</a>&nbsp;.&nbsp;IntervalAction
        </span>
      </th>

      <th class="navbar last">
        <a href="javascript:toggleFrames()">Toggle&nbsp;frames</a>
      </th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Wed Oct 26 10:00:12 2011
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
